package com.xayy.mgt.model;

import cn.kawins.mybatis.base.BaseModel;
import cn.kawins.mybatis.interceptor.FillingCreateTime;
import cn.kawins.mybatis.interceptor.InsertAutoFilling;
import cn.kawins.mybatis.interceptor.UpdateAutoFilling;
import cn.kawins.mybatis.util.SnowflakeId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import lombok.*;

/**
 * 节点参数表-一个节点可有多个参数(NodeParamInfo)实体类
 *
 * @author zhangxa
 * @since 2023-08-25 17:28:45
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "health_xw.t_node_param_info")
@EqualsAndHashCode(callSuper = true)
public class NodeParamInfo extends BaseModel<Long> {
    /**
     * 主键ID
     */
    @Id
    @ApiModelProperty(value = "主键")
    @Column(name = "id")
    @KeySql(genId = SnowflakeId.class)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     * 卫星ID
     */
    @Column(name = "satellite_id")
    @ApiModelProperty(value = "卫星ID")
    private Long satelliteId;
    /**
     * 节点ID
     */
    @Column(name = "node_id")
    @ApiModelProperty(value = "节点ID")
    private Long nodeId;
    /**
     * 参数名
     */
    @Column(name = "name")
    @ApiModelProperty(value = "参数名")
    private String name;

    /**
     * 遥测代号
     */
    @Column(name = "code")
    @ApiModelProperty(value = "遥测代号")
    private String code;


    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @InsertAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "创建时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "2010-01-01 00:00:00")
    private Date createdTime;
    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @UpdateAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "最后更新时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "2010-01-01 00:00:00")
    private Date updatedTime;

}
